package com.qfhd.soft.cjzcore.UI.MulitRecycle.bean;


import android.content.Context;

import com.qfhd.soft.cjzcore.Model.Task_image_item_model;
import com.qfhd.soft.cjzcore.R;
import com.qfhd.soft.cjzcore.UI.MulitRecycle.decorate.Visitable;
import com.qfhd.soft.cjzcore.UI.MulitRecycle.factory.TypeFactory;


public class Task_image_Bean implements Visitable {
    Task_image_item_model model;
    Context mContext;

    public Task_image_Bean(Task_image_item_model model, Context context){
        this.model = model;
        this.mContext = context;
    }

    public Task_image_item_model getModel(){
        return model;
    }

    //1.注册任务 2.投票 3.转发 4.分享
    public int getIconResid(){
        switch (model.iconType){
            case 3:{
                return R.drawable.zhuanfa;
            }
            case 2:{
                return R.drawable.toupiao;
            }
            case 1:{
                return R.drawable.zhuce;
            }
            case 4:{
                return R.drawable.fenxiang;
            }
            default:{
                return R.drawable.placeholder;
            }
        }
    }

    public String getSubTitle(){
        switch (model.iconType){
            case 3:{
                return "转发";
            }
            case 2:{
                return "投票";
            }
            case 1:{
                return "注册";
            }
            case 4:{
                return "分享";
            }
            default:{
                return "无";
            }
        }
    }

    public int getStatusBackground(){
        switch (model.ut_status) {
            case 0: {
//                return "提交";
                return mContext.getResources().getColor(R.color.white);
            }
            case 1: {
//                return "审核中";
                return mContext.getResources().getColor(R.color.orange);
            }
            case 2: {
//                return "已到账";
                return mContext.getResources().getColor(R.color.theme_green);
            }
            case 3: {
//                return "提交(审核失败)";
                return mContext.getResources().getColor(R.color.themeRed);
            }
            default: {
                return mContext.getResources().getColor(R.color.white);
            }
        }
    }

    public Context getmContext(){
        return mContext;
    }

    public String getIconUrl(){
        return model.icon;
    }

    public String getTitle(){
        return model.title;
    }

    public float getMoney(){
        return model.money;
    }

    public int getHaveCount(){
        return model.totalCount-model.doneCoount;
    }

    public String getId(){
        return model.id;
    }

    @Override
    public int type(TypeFactory typeFactory) {
        return typeFactory.type(this);
    }
}
